package com.topwalk.step01;

import lombok.extern.slf4j.Slf4j;

/**
 * 无锁程序
 *
 * @author tang
 * @since 2023/10/11
 */
@Slf4j
public class Demo5_1NoneLock {

    public static void main(String[] args) {
        new Thread(new ThreadA()).start();
        new Thread(new ThreadB()).start();
    }

    static class ThreadA implements Runnable {

        @Override
        public void run() {
            for (int i = 0; i < 100; i++) {
                log.debug("Thread A {}", i);
            }
        }

    }

    static class ThreadB implements Runnable {

        @Override
        public void run() {
            for (int i = 0; i < 100; i++) {
                log.debug("Thread B {}", i);
            }
        }

    }

}
